{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link type="text/css" rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.css' %}">
    <script type="text/javascript" src="{% static 'bootstrap/js/jquery-2.0.2.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.js' %}"></script>
</head>
<body>
<div id="header">
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">Brand</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li><a href="#">用户管理<span class="sr-only">(current)</span></a></li>
                    <li><a href="#">角色管理</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false">Admin<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">个人中心</a></li>
                            <li><a href="#">修改密码</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="#">安全退出</a></li>
                        </ul>
                    </li>
                </ul>
            </div><!-- /.navbar-collapse -->
        </div>
    </nav>
</div>

<div class="container">
    <div style="margin-bottom: 15px">
        <a href="/app04/add">
            <button type="button" class="btn btn-primary">新增</button>
        </a>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">教师列表</div>
        <div class="panel-body">
            <table class="table  table-striped">
                <tr>
                    <th>名字</th>
                    <th>年龄</th>
                    <th>薪资</th>
                    <th>联系方式</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                {% for teacher in teachers %}
                    <tr>
                        <td>{{ teacher.name }}</td>
                        <td>{{ teacher.age }}</td>
                        <td>{{ teacher.salary }}</td>
                        <td>{{ teacher.tel }}</td>
                        <td>{{ teacher.create_time | date:'Y-m-d H:i:s' }}</td>
                        <td>
                            <a href="/app04/edit?id={{ teacher.id }}">
                                <button type="button" class="btn btn-primary">编辑</button>
                            </a>
                            <a href="/app04/delete/{{ teacher.id }}">
                                <button type="button" class="btn btn-danger">删除</button>
                            </a>
                        </td>
                    </tr>
                {% endfor %}
                {% if not teachers %}
                    <tr>
                        <td colspan="6">
                            没有数据请添加!!!
                        </td>
                    </tr>
                {% endif %}

            </table>
        </div>
    </div>
</div>


</body>
</html>